const state = {
  dataviewMap: [],    // 数据视图集合

  printTemplateList: [],    // 打印配置列表

  warehouseAll: [],    // 所有仓库列表


  deptListByUser: [],    // 用户可用科室列表

  warehouseListByUser: [],    // 用户可用仓库列表


  deptListBus: [],    // 所有业务科室
  flowMap: [],    // 流程对象
  hospitalList: [],    // 医院列表
  navMenuList: [],    // 用户菜单列表
  spList: [],    // 供应商列表
}

const getters = {
  dataviewMap: state => state.dataviewMap,
  printTemplateList: state => state.printTemplateList,
  warehouseAll: state => state.warehouseAll,
  deptListByUser: state => state.deptListByUser,
  warehouseListByUser: state => state.warehouseListByUser,
  deptListBus: state => state.deptListBus,
  flowMap: state => state.flowMap,
  hospitalList: state => state.hospitalList,
  navMenuList: state => state.navMenuList,
  spList: state => state.spList,
}

const mutations = {
  setDataviewMap: (state, map) => {
    state.dataviewMap = map
  },
  setPrintTemplateList: (state, list) => {
    state.printTemplateList = list
  },
  setWarehouseAll: (state, list) => {
    state.warehouseAll = list
  },
  setDeptByUserId: (state, list) => {
    state.deptListByUser = list
  },
  setWarehouseByUserId: (state, list) => {
    state.warehouseListByUser = list
  },
  setDeptBus: (state, list) => {
    state.deptListBus = list
  },
  setFlowMap: (state, flowMap) => {
    state.flowMap = flowMap
  },
  setHospitalList: (state, list) => {
    state.hospitalList = list
  },
  setNavMenuList: (state, list) => {
    state.navMenuList = list
  },
  setSpList: (state, list) => {
    state.spList = list
  }
}

const actions = {
  setDataviewMap: (context, map) => context.commit('setDataviewMap', map),
  setPrintTemplateList: (context, list) => context.commit('setPrintTemplateList', list),
  setWarehouseAll: (context, list) => context.commit('setWarehouseAll', list),
  setDeptByUserId: (context, list) => context.commit('setDeptByUserId', list),
  setWarehouseByUserId: (context, list) => context.commit('setWarehouseByUserId', list),
  setDeptBus: (context, list) => context.commit('setDeptBus', list),
  setFlowMap: (context, map) => context.commit('setFlowMap', map),
  setHospitalList: (context, list) => context.commit('setHospitalList', list),
  setNavMenuList: (context, list) => context.commit('setNavMenuList', list),
  setSpList: (context, list) => context.commit('setSpList', list),
}

export default {
  state,
  getters,
  mutations,
  actions
}
